package controller;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import service.RankService;
import vo.DepartmentVO;
import vo.MemberVO;
@Controller
public class RankController {
	@Resource(name="rankServiceImpl")
	private RankService rankService;
	
	@RequestMapping("stepup_rank.sds")
	public String rankPage(){
		return "stepup_rank" ;
	}
	
	@RequestMapping("member_month_ranking.sds")
	@ResponseBody
	public List<MemberVO> memberMonthRanking(String type){
		System.out.println("type ? "+type);
		List<MemberVO> list = rankService.memberMonthRank(type);
		System.out.println(list);
		return list;
	}
	
	@RequestMapping("dept_month_ranking.sds")
	@ResponseBody
	public List<DepartmentVO> deptMonthRanking(String type){
		System.out.println("type ? "+type);
		List<DepartmentVO> list = rankService.deptMonthRank(type);
		return list;
	}
	
	@RequestMapping("today_count.sds")
	@ResponseBody
	public Map<String, Integer> todayCount(){
		Map<String, Integer> returnMap = rankService.todayCount();
		return returnMap;
	}
	
}
